package cs304.p3.library.domain;

import java.util.List;

public class Book {

	private String callNumber;
	private String isbn;
	private String title;
	private String mainAuthor;
	private List<String> authors;
	private String publisher;
	private int year;
	private List<String> subjects;
	private int inCount;
	private int outCount;

	public Book() {
	}

	/**
	 * Constructor for insert table
	 */
	public Book(String callNumber, String isbn, String title, String mainAuthor, String publisher,
			int year) {
		this.callNumber = callNumber;
		this.isbn = isbn;
		this.title = title;
		this.mainAuthor = mainAuthor;
		this.publisher = publisher;
		this.year = year;
	}
	
	public Book(String callNumber, String isbn, String title, String mainAuthor, List<String> authors, String publisher,
			int year, List<String> subjects) {
		this.callNumber = callNumber;
		this.isbn = isbn;
		this.title = title;
		this.mainAuthor = mainAuthor;
		this.authors = authors;
		this.publisher = publisher;
		this.year = year;
		this.subjects = subjects;
	}

	public void setCallNumber(String callNumber) {
		this.callNumber = callNumber;
	}

	public String getCallNumber() {
		return callNumber;
	}

	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}

	public String getIsbn() {
		return isbn;
	}

	public void setMainAuthor(String mainAuthor) {
		this.mainAuthor = mainAuthor;
	}

	public String getMainAuthor() {
		return mainAuthor;
	}

	public void setAuthors(List<String> authors) {
		this.authors = authors;
	}

	public List<String> getAuthors() {
		return authors;
	}

	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}

	public String getPublisher() {
		return publisher;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getTitle() {
		return title;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public int getYear() {
		return year;
	}

	public void setSubjects(List<String> subjects) {
		this.subjects = subjects;
	}

	public List<String> getSubjects() {
		return subjects;
	}

	public void setInCount(int in) {
		this.inCount = in;
	}

	public int getInCount() {
		return inCount;
	}

	public void setOutCount(int out) {
		this.outCount = out;
	}

	public int getOutCount() {
		return outCount;
	}
	
	public String toString(){
		StringBuilder builder = new StringBuilder();
		
		builder.append("Call Number: ");
		builder.append(callNumber);
		builder.append(", ISBN: ");
		builder.append(isbn);
		builder.append(", Title: ");
		builder.append(title);
		builder.append(", Author: ");
		builder.append(mainAuthor);
		builder.append(", Sub-Authors: ");
		for(String a : authors){
			builder.append(a);
			builder.append(", ");
		}
		builder.append("Publisher: ");
		builder.append(publisher);
		builder.append(", Year: ");
		builder.append(year);
		builder.append(", Subjects: ");
		for(String sub : subjects){
			builder.append(sub);
			builder.append(", ");
		}
		builder.append("In Count: ");
		builder.append(inCount);
		builder.append(", Out Count: ");
		builder.append(outCount);
		
		return builder.toString();
	}
}
